import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
import { testRouter } from './test'
import { crudRouter } from './crud'
import { userRouter } from './user'
import { newsRouter } from './news'
import { localRouter } from './local'
import { designRouter } from './design'
import { messageRouter } from './message'
import { adminRouter } from './admin'

let routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: () => import('../views/HomeView.vue'),
  },
  {
    path: '/exam',
    name: 'exam',
    component: () => import('../views/ExamView.vue'),
  },
]
routes = routes.concat(
  testRouter,
  crudRouter,
  userRouter,
  newsRouter,
  localRouter,
  messageRouter,
  designRouter,
  adminRouter,
)

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes,
})

export default router
